﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Physis.Client.Models.Entity {

    public class EntityModel : ApplicationModel {

        #region Public Properties

        public virtual Core.Entity.Entity Entity { get { return null; } }

        public virtual Int64 EntityId { set { /* DO NOTHING */ } }

        #endregion


        #region Public Methods

        public override void UpdateValues (System.Collections.Specialized.NameValueCollection form) {

            base.UpdateValues (form);


            // RELOAD BASE OBJECT FROM DATABASE 

            EntityId = Data.Readers.FormReader.Int64FromForm (form, "Entity.Id");


            Entity.FederalTaxId = Data.Readers.FormReader.StringFromForm (form, "Entity.FederalTaxId");

            Entity.UniqueId = Data.Readers.FormReader.StringFromForm (form, "Entity.UniqueId");

            Entity.LegacyId = Data.Readers.FormReader.StringFromForm (form, "Entity.LegacyId");

            return;

        }

        #endregion 

    }

}